package com.example.hospitalsystem.mapper;

import com.example.hospitalsystem.pojo.entity.PrescriptionPharmacy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.hospitalsystem.pojo.vo.PrescriptionPharmacyVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * 处方/药品关联表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-04-15
 */
@Mapper
public interface PrescriptionPharmacyMapper extends BaseMapper<PrescriptionPharmacy> {
    /**
     * 批量开具药品
     * @param prescriptionPharmacyList
     */
    void insertBatchMedicine(List<PrescriptionPharmacy> prescriptionPharmacyList);

    /**
     * 根据处方id删除处方/药品关联表数据
     * @param prescriptionId
     */
    @Delete("delete from prescription_pharmacy where prescription_id = #{prescriptionId}")
    void deleteByPrescriptionId(Integer prescriptionId);
}
